Skip to content

Support constant folding for insert values#17850

Open
Caideyipi wants to merge 2 commits into
masterfrom
insert-values-constant-folding
Open

Support constant folding for insert values#17850
Caideyipi wants to merge 2 commits into
masterfrom
insert-values-constant-folding

Conversation

@Caideyipi
Copy link
Copy Markdown
Collaborator

Summary

  • defer table-model INSERT VALUES materialization until analysis so values can reuse IrExpressionInterpreter constant folding
  • throw a readable SemanticException when an insert expression still is not constant after folding
  • add relational session coverage for folded INSERT VALUES expressions

Verification

  • mvn -pl iotdb-core/datanode spotless:check
  • mvn -pl integration-test spotless:check -P with-integration-tests
  • mvn -pl iotdb-core/datanode -DskipTests compile (fails in pre-existing generated aggregation sources: missing ComparatorChain / getModeMapSizeThreshold)

@Caideyipi Caideyipi force-pushed the insert-values-constant-folding branch from 96ed42c to 88803de Compare June 5, 2026 04:08
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 0.56180% with 177 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.79%. Comparing base (594fb87) to head (88803de).

Files with missing lines Patch % Lines
...ryengine/plan/relational/sql/ast/InsertValues.java 0.00% 140 Missing ⚠️
.../queryengine/plan/relational/sql/util/AstUtil.java 0.00% 32 Missing ⚠️
...yengine/plan/relational/sql/parser/AstBuilder.java 0.00% 3 Missing ⚠️
...ne/plan/relational/analyzer/StatementAnalyzer.java 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17850      +/-   ##
============================================
- Coverage     40.81%   40.79%   -0.02%     
- Complexity     2610     2612       +2     
============================================
  Files          5200     5201       +1     
  Lines        353732   353774      +42     
  Branches      45266    45270       +4     
============================================
- Hits         144361   144339      -22     
- Misses       209371   209435      +64     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 5, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant